export function toCSSLength(val: string | number) {
    return typeof val === "number" ? `${val}rem` : val
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function attachPropertiesToComponent<C, P extends Record<string, any>>(
    component: C,
    properties: P,
): C & P {
    const ret = component
    for (const key in properties) {
        if (Object.prototype.hasOwnProperty.call(properties, key)) {
            // @ts-ignore
            ret[key] = properties[key]
        }
    }
    // @ts-ignore
    return ret
}
